<!--DOCTYPE xs:schema SYSTEM "c:\dat\xml\schemapt1.dtd"-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:sn="http://www.snee.com/ns/stages">

  <xs:element name="article">

    <xs:annotation>
      <xs:appinfo>
        <sn:stages>
          <sn:stage name="public"/>
          <sn:stage name="post-floob"/>
          <sn:stage name="post-zatz"/>
          <sn:stage name="final"/>
        </sn:stages>
      </xs:appinfo>
    </xs:annotation>

    <xs:complexType>
      <xs:sequence>
        <xs:element ref="title" maxOccurs="1"/>
        <xs:element ref="par"   maxOccurs="unbounded"/>
      </xs:sequence>

      <xs:attribute name="dateline" type="xs:string" use="required"
                    sn:stages="post-zatz final"/>

      <xs:attributeGroup ref="stamps"
                         sn:stages="post-floob post-zatz final"/>

    </xs:complexType>
  </xs:element>


  <xs:element name="title" type="xs:string"/>


  <xs:element name="par">
   <xs:complexType mixed="true">

    <xs:choice minOccurs="0" maxOccurs="unbounded">
     <xs:element ref="company" sn:stages="post-zatz final"/>
     <xs:element ref="product" sn:stages="post-zatz final"/>
     <xs:element ref="link"    sn:stages="post-zatz final"/>
     <xs:element ref="a" sn:stages="public post-floob"/>
     <xs:element ref="person"/>
    </xs:choice>

   </xs:complexType>
 </xs:element>


  <xs:element name="company">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="id" type="xs:ID" use="required"
              sn:stages="final"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>


  <xs:element name="product" type="xs:string"/>


  <xs:element name="link">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="uri" type="xs:anyURI" use="required"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>


  <xs:element name="a" sn:stages="public post-floob">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="href" type="xs:anyURI" use="required"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>


  <xs:element name="person" type="xs:string"/>


  <xs:attributeGroup name="stamps" sn:stages="post-floob post-zatz">
    <xs:attribute name="checkIn" type="xs:dateTime" use="required"/>
    <xs:attribute name="aid"     type="xs:string" use="required"/>
  </xs:attributeGroup>

  <!-- checkIn is optional in following, required in preceding
       stamps attributeGroup. -->
  <xs:attributeGroup name="stamps" sn:stages="final">
    <xs:attribute name="checkIn" type="xs:dateTime" use="optional"/>
    <xs:attribute name="aid"     type="xs:string" use="required"/>
  </xs:attributeGroup>


</xs:schema>